#!/usr/bin/expect

set timeout 5
set name [lindex $argv 0]
set pwd [lindex $argv 1]
set hname [lindex $argv 2]
set hpwd [lindex $argv 3]
spawn ssh -p 60022 $name@10.10.225.120
expect "*password*"
send "$pwd\r"
expect "USMshell:"
send "ssh 106.75.14.105\r"
expect "yhhy@"
send "ssh $hname@10.19.129.249\r"
expect "password"
send "$hpwd\r"
expect "root@"
send "hbase shell\r"
interact
